﻿@using AidBrella.Enums
@model AidBrella.ViewModels.ProjectViewModel
      <script type="text/javascript"  src="@Url.Content("~/Scripts/js/project.js")"></script>           
       <script type="text/javascript"  src="@Url.Content("~/Scripts/js/feed.js")"></script>           
  
<div id="user-context-view">

<div id="user-picture">
 <img alt="pic" src="../../Content/images/Picture_Not_Available.jpg" />
</div>
  <p>  Welcome <a href="/Index/UserFrontPage"> @User.Identity.Name </a> </p>
<div id="project-links">
     
    <p><a  href="/Project">Projects</a> </p>
    <p><a href="">Friends</a> </p>
</div>
</div>

<div id="project-feed" >
 <input type="hidden" id="projectId" value="@Model.Id" />  
  <div id="project-top">
       Info
     <h3 class="project-detail-heading"> @Model.Name </h3>
                
    <p> <b> Project Sector: </b> @Model.ProjectSectorInString </p>
    <p><b> Start date: </b>@if (@Model.StartDate.HasValue){ @Model.StartDate.Value.ToShortDateString() }else { <span>Not available</span> } </p>
    <p><b > End date: </b>@if (@Model.EndDate.HasValue){ @Model.EndDate.Value.ToShortDateString() } else { <span>Not available</span> } </p>
       
  </div>
  <div id="project-action"> 
  @if (@Model.UserBelongsToProjectAs == UserRoleType.None)
  {
     <p><button id="volunteerBtn" >Join as a Volunteer</button> <button id="staffBtn">Join as a Staff</button>   </p>
  }
  else { 
    <p> You are a <i> @Model.UserBelongsToProjectAs.ToString() </i> in this project  </p>
  }
  </div>
  <div id="project-wall">
    
    @if (@Model.UserCanUpdateThis)
    {
       
        <div class="stream-composer">
           <form action="">
              <textarea cols=""  onfocus="this.value= ''"   rows="2" class="textarea-box" id="status-txt">Share the status of your project</textarea>
              <input type="button" value="Share" id="share-button" onclick="updateStatus();" />
            </form>
            <hr />
        </div>
    }
     <div id="feed-holder">  
      
        <input type="hidden" id="spot" value="project" />  
       <script type="text/javascript">
           getProjectFeed();
       </script> 
        <div id="feeds"> </div>
     </div>

  </div>
 
 </div>

  <div id="project-members">
     <p> Project Members </p>
      <hr />
      @foreach (var member in Model.Members)
      {
       
          <a href="/Profile/Account/@member.UserId"> <p> @String.Format("{0} {1}", member.FirstName, member.LastName) </p></a>
          <p>Role : @member.MemberAs </p>
          <hr />
      }
  </div>



       





